package com.jxlg.execrise.controller;

import com.jxlg.execrise.pojo.Student;
import com.jxlg.execrise.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@RestController
public class StudentController {

    @Autowired
    private StudentService studentService;

    @GetMapping("/find")
    public Student find(int id){
      Student student=studentService.select(id);
      return student;
    }

    @GetMapping("/findAll")
    public List<Student> findAll(){
        List<Student> students=studentService.selectAll();
        return students;
    }

    @PostMapping("/insert")
    public String insertData(){

        return "新增成功";

    }

    @PostMapping("/delete")
    public String deleteData(int id){
        return "删除成功";
    }

}
